from fb.open_graph.base import OpenGraphObject

class BaseVideo():
  
  def get_video_actors(self):
    return ()
  
  def get_video_directors(self):
    return ()
  
  def get_video_writers(self):
    return ()
  
  def get_video_duration(self):
    return 0
  
  def get_video_release_date(self):
    return ''
  
  def get_video_tags(self):
    return ()
  
  def get_open_graph_attributes(self):
    attrs = super(BaseVideo, self).get_open_graph_attributes()
    
    attrs.append(('video:duration', self.get_video_duration()))
    attrs.append(('video:release_date', self.get_video_release_date()))
    
    for actor in self.get_video_actors():
      attrs.append(('video:actor', actor['url']))
      attrs.append(('video:actor:role', actor['role']))
      
    for director in self.get_video_directors():
      attrs.append(('video:director', director))
      
    for writer in self.get_video_writers():
      attrs.append(('video:writer', writer))
      
    for tag in self.get_video_tags():
      attrs.append(('video:tag', tag))
    
    return attrs
  

class Movie(BaseVideo):
  def get_open_graph_type(self):
    return 'video.movie'


class  TvShow(BaseVideo):
  def get_open_graph_type(self):
    return 'video.tv_show'


class OtherVideo(BaseVideo):
  def get_open_graph_type(self):
    return 'video.other'
  
  
class Episode(BaseVideo):
  def get_open_graph_type(self):
    return 'video.episode'
  
  def get_episode_series(self):
    return ''
  
  def get_open_graph_attributes(self):
    attrs = super(Episode, self).get_open_graph_attributes()
    attrs.append(('video:series', self.get_episode_series()))
    return attrs
  

    
    